package com.asm.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Configuring static resource mapping
 * @author Administrator
 */
@Configuration
public class WebStaticConfig implements WebMvcConfigurer {

    private static final Logger log = LoggerFactory.getLogger(WebStaticConfig.class);

    /**
     * Adding static resource and public page files, the address can be accessed directly from outside
     *
     * @param registry registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        log.info("Adding static resources and public page files.");
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }

}
